package com.huiyou.adminapi.repository;

import com.huiyou.adminapi.common.model.Product;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface ProductRepository extends JpaRepository<Product, String> {
    Page<Product> findByNameContainingOrderByUpdateTimeDesc(String name, Pageable pageable);

    List<Product> findByName(String name);

    List<Product> findByNameAndIdIsNot(String name, String id);
}
